import axios from 'axios'

// 获取所有字段配置
export const getAllFieldConfigs = () => {
  return axios.get('/api/field-configs')
}

// 根据模块ID获取字段配置
export const getFieldConfigsByModuleId = (moduleId) => {
  return axios.get(`/api/field-configs/module/${moduleId}`)
}

// 根据ID获取字段配置
export const getFieldConfig = (id) => {
  return axios.get(`/api/field-configs/${id}`)
}

// 保存或更新字段配置
export const saveFieldConfig = (config) => {
  return axios.post('/api/field-configs', config)
}

// 删除字段配置
export const deleteFieldConfig = (id) => {
  return axios.delete(`/api/field-configs/${id}`)
}
